Skip to content

Feat: Add Swift-wasm suppport to DataLoader #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

scottmarchant
Copy link

@scottmarchant scottmarchant commented Jun 20, 2025

Summary

This PR adds support for compiling DataLoader to wasm using the SwiftWasm sdk.

This PR is part of a larger effort by a company called PassiveLogic to enable broad support for SwiftWasm.

Details

Currently, NIOCore compiles to wasm, but NIOPosix and many other portions of NIO do not. The main change here is to isolate the main DataLoader module to use only NIOCore. The module was already using only NIOCore, but the imports and package configuration consumed all of NIO, breaking wasm compilation.

Testing done

Ran swift format per the contribution guide, and verified unit tests still pass with these changes. Also tested this change

Impact Risk

Realistically, this change should not cause any impact or risk. It does not change any public-facing code other than import sanitization and dependency cleanup.

@NeedleInAJayStack NeedleInAJayStack self-assigned this Jun 20, 2025
Copy link
Member

@NeedleInAJayStack NeedleInAJayStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Scott! These changes look great! Just some minor things caught by CI

…tWasm. Removes broad NIO dependency from DataLoader module, as it actually depends only on NIOCore, not all of NIO.
…such as NIOCore and/or NIOPosix, rather than the much larger dependency of just NIO.
@scottmarchant scottmarchant force-pushed the feat/swift-wasm-support branch from ed27c6f to 68720a6 Compare June 20, 2025 15:51
Copy link
Member

@NeedleInAJayStack NeedleInAJayStack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks Scott!

@NeedleInAJayStack NeedleInAJayStack merged commit 56ae64a into GraphQLSwift:main Jun 20, 2025
9 checks passed
@scottmarchant scottmarchant deleted the feat/swift-wasm-support branch June 23, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants